
# 定义一个图型类Shape
class Shape:
    # 1.
    # *
    # **
    # ***
    def triangle1(self, n):
        for line in range(1, n+1):  # line代表第几行
            print('*' * line)

    # 2.
    #   *
    #  **
    # ***
    def triangle2(self, n):
        for line in range(1, n+1):
            star_count = line
            blank_count = n - star_count
            aline = ' ' * blank_count + '*' * star_count
            print(aline)

    # 3.
    # ***
    # **
    # *
    def triangle3(self, n):
        for star_count in range(n, 0, -1):
            print('*' * star_count)

    # 4.
    # ***
    #  **
    #   *
    def triangle4(self, n):
        for star_count in range(n, 0, -1):
            blank_count = n - star_count
            aline = ' ' *  blank_count + '*' * star_count
            print(aline)

def main():
    n = int(input('请输入:'))
    shape_object = Shape()
    shape_object.triangle1(n)
    print('---------')
    shape_object.triangle2(n)
    print('---------')
    shape_object.triangle3(n)
    print('---------')
    shape_object.triangle4(n)

# ？？？？ 有几个全局变量
main()